﻿using System;
using System.Text;
using System.Web.UI;
using Microsoft.Live.ServerControls.VE;

namespace Microsoft.Live.ServerControls.Web
{
    public partial class FindTest : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void findit_Click(object sender, EventArgs e)
        {
            myMap.Find(what.Text, where.Text, FindType.Businesses, null, 0, 10, true, true, false, true);
        }

        protected void myMap_ServerFind(object sender, FindEventArgs e)
        {
            StringBuilder str = new StringBuilder();
            foreach (FindResult item in e.ResultsArray)
            {
                str.Append(item.Name);
                str.Append("<br />");
            }
            results.Text = str.ToString();

            foreach (Place item in e.Places)
            {
                myMap.AddShape(new Shape(ShapeType.Pushpin, item.LatLong));
            }
        }
    }
}